var url = urls();
var params = oneValues();
var page = 1;
if (params.page != undefined) {
    page = parseInt(params.page);
}
function honour_list() {
    $.ajax({
        type: "post",
        url: url + "/api/statement/lv_qu",
        data: {
            number: 9,
            type: 1,
            page: page
        },
        dataType: "json",
        success: function (res) {
            honour(res)
        }
    });
}

function honour(res) {
    var arr = res.data.data;
    var pageNum = Math.ceil(res.data.total / 9);
    var a = '';
    for (i in arr) {
        a += '<li class="honour_img_box"><div class="honour_img" style="background: url(' + url +
            '/upload/' + arr[i].thumbnail +
            ') no-repeat; background-size:100% 100%"><div class="honour_bg"><div class="honour_bg_iocn_box"><div class="honour_icon"></div><p>查看大图</p></div><img class="honour_show" data-original="' +
            url + '/upload/' + arr[i].image + '" src="' + url + '/upload/' + arr[i].thumbnail +
            '" alt="' + arr[i].title + '"></div></div></li>';
    }
    $("#viewer").html(a);

    $('#viewer').viewer({
        url: 'data-original',
        // movable: false, //移动
        title: false, //标题
        // navbar: false,  //缩略图
        // transition: false,   //动画
    })
    $("#viewer").viewer('update');

    $("#page").paging({
        nowPage: page, // 当前页码
        pageNum: pageNum, // 总页码
        buttonNum: 7, //要展示的页码数量
        callback: function (num) { //回调函数
            $(".page_bg").css("display", "block");
            window.location.href = url + "/portal/index/honour.html?page=" + num;
        }
    });
}
$(function () {
    honour_list();
})